package com.g2.admin.common.conf;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "g2.token")
@Data
public class TokenProperties {
    /**
     * 令牌自定义标识
     */
    private String header;
    public static String HEADER = "Authorization";
    /**
     * 令牌秘钥
     */
    private String secret;
    public static String SECRET = "8b5a3890f89cb5e30f7909942d91a25b";
    /**
     * 令牌有效期（默认30分钟）
     */
    private int expireTime;
    public static int EXPIRE_TIME = 1;

    public void setHeader(String header) {
        this.header = HEADER = header;

    }

    public void setSecret(String secret) {
        this.secret = SECRET = secret;
    }

    public void setExpireTime(int expireTime) {
        this.expireTime = EXPIRE_TIME = expireTime;
    }
}
